<script setup lang="ts">
import { inject } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import map from '../assets/img/map.jpg'

//注入一个由祖先组件或整个应用 (通过 app.provide()) 提供的值。
const pager: any = inject('pager');
//rxjs的发布
pager.next({ a: 'pppp' })


let router = useRouter()
let route = useRoute()
function toURL(url: string, query: {}): void {
  router.push(url)
}

console.log(route.path, 888);
console.log(route.query, 888);
console.log(route, 888);
</script>

<template>
  <div class="temp">
    <h1>vue2 HomePage1</h1>
    <button class="btn" @click="toURL('/microVue/HomePage1', {})">子应用里跳Vue/HomePage1</button>
    <img :src="map" style="width: 20px;" alt="">
  </div>
</template>

<style>
button{
  height: 60px;
  background: yellow;
}
</style>